/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lab2sum;

/**
 *
 * @author Daryna_Ragimova
 */
public class OneThread extends Thread {

    private double sum = 0.0;
    private int first;
    private int last;

    public OneThread(int first, int last) {
        this.first = first;
        this.last = last;
    }

    public void run() {
        for (int i = first; i < last; i++) {
            sum += Math.sin(i);
        }
    }

    public double getSum() {
        return sum;
    }
 
}
